﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegisterLC.aspx.cs" Inherits="RN.ERP.Web.RegisterLC" %>

<%@ Register Src="UserControl/UCUserRight.ascx" TagName="UCUserRight" TagPrefix="ucUserRight" %>
<%@ Register Src="~/UserControl/UCArea.ascx" TagName="UCArea" TagPrefix="ucArea" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户注册</title>
    <link href="Styles/skins/lcblue/css/style_register.css" type="text/css" rel="stylesheet" />
    <link href="Styles/skins/lcblue/css/kendo.common.min.css" type="text/css" rel="stylesheet" />
<%--    <link href="Styles/skins/blue/css/kendo.default.min.css" type="text/css" rel="stylesheet" />--%>
        <link href="Styles/skins/blue/css/kendo.blueopal.min.css" type="text/css" rel="stylesheet" />
    <link href="Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" language="javascript" src="Scripts/kendo.web.min.js"></script>
    <script type="text/javascript" language="javascript" src="../Scripts/json-data.js"></script>

     <script type="text/javascript">
         $(document).ready(function () {
             $("#tabstrip").kendoTabStrip({
                 animation: {
                     open: {
                         effects: "fadeIn"
                     }
                 }
             });
             var tabStrip = $("#tabstrip").kendoTabStrip().data("kendoTabStrip");
             var validator = $("#CorpReg").kendoValidator().data("kendoValidator");
             $("#button").click(function () {
                 if (validator.validate()) {
                     var userName = $("#userName").val();
                     var orgCode = $("#orgCode").val();
                     var corpType = $("#DDLCorpUserType").val();
                     var dogId = $("#hdnDogid").val();
                     $.ajax({
                         async: false,
                         url: "RegisterLC.aspx/VerifyCorpReg",
                         data: "{ 'userName':'" + userName + "','orgCode':'" + orgCode + "', 'corpType':'" + corpType + "', 'dogId':'" + dogId + "'}",
                         type: "post",
                         cache: false,
                         contentType: "application/json; charset=utf-8",
                         dataType: "json",
                         success: function (data) {
                             var json = eval('(' + data.d + ')');
                             if (json.status1 == "-1") {
                                 verify = false;
                                 $.ligerDialog.warn('用户名已存在');
                                 return;
                             }
                             if (json.status2 == "-2") {
                                 verify = false;
                                 $.ligerDialog.warn('组织机构代码已存在');
                                 return;
                             }
                             $.ajax({
                                 async: false,
                                 url: "Handlers/RegistryHandler.ashx",
                                 data: $('#CorpReg').serialize(),
                                 type: "post",
                                 cache: false,
                                 success: function (data) {
                                     if (data.result == 1) {
                                         $.ligerDialog.success('注册成功', 300, 150, '提示');
                                         window.location.href("Login.aspx");
                                     }
                                     else {
                                         $.ligerDialog.error('注册失败:' + data.message);
                                     }
                                 }
                             });
                         }
                     });
                 }
             });

             var validator2 = $("#formEdit").kendoValidator().data("kendoValidator");
             $("#corpRegEdit").click(function () {
                 validator2.validate();
             });

             $("#shichangLogin").click(function () {
                 var username = $('#inp_name').val();
                 var password = $('#inp_pass').val();
                 var dogId;
                 if (username == "" || password == "") {
                     _dialog("error", '用户名或密码不能为空');
                     //radalert('用户名或密码不能为空', 300, 150, '提示');
                 }
                 else {
                     $.ajax({
                         type: 'post',
                         cache: false,
                         dataType: 'json',
                         url: 'RegisterLC.aspx',
                         data: { username: username, password: password, dogId: "-1", type: "User", action: "CorpRegEdit" },
                         success: function (data) {
                             if (data.length == 0 || data == null) {
                                 OpenAlert("未查询到有效数据！");
                                 return false;
                             }
                             if (data.result == 1) {
                                 $("#divEdit").hide();
                                 OpenAlert(data.message);
                                 return false;
                             }
                             if (data.result == 0) {
                                 var userInfo = data.userInfo;
                                 var corpInfo = data.corpInfo;
                                 ////企业信息
                                 if (corpInfo != null) {
                                     SetControlVal("divCorp", corpInfo); ////基本信息页面控件赋值
                                     $("#divEdit").show();
                                 }
                                 if (userInfo != null) {
                                     SetControlVal("divUser", userInfo); ////基本信息页面控件赋值
                                 }
                             }
                         },
                         error: function () {
                             $("#divEdit").hide();
                             _dialog("error", '登录失败，请与客服联系！');
                         },
                         beforeSend: function () {
                             _dialog("waitting", "正在登录中,请稍后...");
                             $("#btnLogin").attr("disabled", true);
                         },
                         complete: function () {
                             $.ligerDialog.closeWaitting();
                             $("#btnLogin").attr("disabled", false);
                         }
                     });
                 }
             });

             $(function () {
                 $("#back").click(function () {
                     window.location.href = "LCLogin.aspx";
                 });
                 $("#orgCode").blur(function () {
                     var orgCode = $(this).val().trim();
                     var corpType = $("#DDLCorpUserType").val();
                     if (orgCode != "") {
                         $.getJSON("Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "CheckCorpByOrgCode", "data": orgCode, "roleId": corpType, "rand": Math.random() }, function (data) {
                             if (data.Result) {
                                 //组织机构代码已注册
                                 $.ligerDialog.confirm(data.Message + '，是否为同一家企业？', GetCorpInofo);
                                 return false;
                             }
                             function GetCorpInofo(arg) {
                                 if (arg) {
                                     //同一家企业则dogid取已注册企业的dogid
                                     $("#hdnDogid").val(data.Dogid);

                                 }
                                 else {
                                     $("#orgCode").val("");
                                     $.ligerDialog.error(data.Message + '，不能重复注册');
                                     return false;
                                 }
                             }
                         });
                     }
                 }
             );
             });
         });

         function _dialog(type, msg) {
             var h = $(".main").height();
             $.ligerDialog[type](msg);
             $(".main").height(h);
         }
     </script>
     <style type="text/css">
         .k-tool-icon  { margin-top: 0px;}
         #tabstrip{ background:none;}
     </style>
</head>
<body>
    <div class="header">
        <div class="logo">
           <%-- <img src="images/logo_login.jpg" width="804" height="97" alt="" />--%>
         </div>
    </div>
        <div class="tab_wm" style="width:980px;margin:0 auto">
        <div id="tabstrip" >
            <ul class="tabstrip_top">
                <li class="k-state-active">企业用户注册 </li>
                <li>注册信息修改</li>
            </ul>
    <!--企业注册-->
        <div class="content" id="content">
            <div>
    <form id="CorpReg" runat="server">
    <input name="action" id="action" type="hidden" value="Corp" />
     <div class="up">
            <img src="images/nrtop.jpg" width="799" height="31" />
      </div>    
     <div class="libg" >
            <div class="tle">
                企业用户注册</div>
            <div class="con_nr">
                <div class="buzhou">
                    <ul>
                        <li class="li01">
                            <img src="images/h01.jpg" width="142" height="52" alt="" /></li>
                        <li class="li_arrow">
                            <img src="images/arrow01.jpg" width="35" height="24" alt="" /></li>
                        <li class="li02">
                            <img src="images/02.jpg" width="142" height="52" alt="" /></li>
                        <li class="li_arrow">
                            <img src="images/arrow02.jpg" width="35" height="24" /></li>
                        <li class="li03">
                            <img src="images/03.jpg" width="142" height="52" alt="" /></li>
                    </ul>
                    <div class="clear">
                    </div>
                </div>
                <asp:HiddenField ID="hdnDogid" runat="server" />
                <ul >
                    <li class="con_main">
                        <div class="con_l">
                            企业类型</div>
                        <div class="con_r">
                            <div class="qy_type">
                                <span class="qy_type_l"></span><span class="qy_type_r">
<%--                                    <select name="" style="width: 105px; border: 0; overflow: hidden; *border: white;">
                                        <option>-请选择-</option>
                                    </select>--%>
                                    <asp:DropDownList ID="DDLCorpUserType" Width="105px" runat="server" AutoPostBack="false" required validationMessage="请选择企业类型">
                                                </asp:DropDownList>
                                    </span></div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="DDLCorpUserType"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            企业名称</div>
                        <div class="con_r">
                            <div class="qy_type_kuan">
                                <span class="qy_type_l"></span><span class="qy_type_kuanr">
                                   <input name="corpName" id="corpName" type="text" style="width: 315px" pattern="^[a-zA-Z\u4e00-\u9fa5()（）]+$" required validationMessage="请输入公司名称" data-pattern-msg="只能输入汉字、字母、小括号"/>                                                              
                             </span>
                            </div>
                            <div class="zuiyou">
                              <span class="k-invalid-msg" data-for="corpName"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            所有权性质</div>
                        <div class="con_r">
                            <div class="qy_type">
                                <span class="qy_type_l"></span><span class="qy_type_r">
<%--                                    <select name="" style="width: 105px">
                                        <option>-请选择-</option>
                                    </select>--%>
                            <asp:DropDownList ID="DDlCorpType" Width="105px" runat="server" required validationMessage="请选择所有权性质">
                            </asp:DropDownList>                                   
                                    </span>
                            </div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="DDlCorpType"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            组织机构代码</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="orgCode" id="orgCode" type="text" style="width: 275px" pattern="\d{8}[-][\d|X]" required validationMessage="请输入组织机构代码"  data-pattern-msg="无效的组织机构代码"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="orgCode"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            营业执照字号</div>
                        <div class="con_r" id="test">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="bussinessNum" id="bussinessNum"  type="text" style="width: 275px" pattern="^[0-9]*$" required validationMessage="请输入营业执照号码"  data-pattern-msg="无效的营业执照号码" /></span>
                            </div>
                            <div class="zuiyou">
                              <span class="k-invalid-msg" data-for="bussinessNum"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            请输入你的用户名</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="userName" id="userName" type="text" style="width: 275px" required validationMessage="请输入用户名"/></span>
                            </div>
                            <div class="zuiyou">
                           <span class="k-invalid-msg" data-for="userName"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            设定一个密码</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="passWord" type="passWord" style="width: 275px" required validationMessage="请输入密码" /></span>
                            </div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="passWord"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            请再次输入密码确认</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="passwordR" id="passwordR" type="password" style="width: 275px" required validationMessage="请再次输入密码"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="passwordR"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            企业注册地</div>
                        <div class="con_r">
                            <div class="qy_usual"><ucArea:ucArea ID="ucArea" Name="ucArea" runat="server" />
                                </div>
                            <div class="zuiyou">
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            电子邮箱地址</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="email" id="email" type="email" style="width: 275px;" required validationMessage="请输入邮箱地址" data-email-msg="邮箱格式无效"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="email"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            联系电话</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input name="linkTel" id="linkTel" type="text" style="width: 275px;" pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" required validationMessage="请输入联系电话"  data-pattern-msg="无效的联系号码" /></span>
                            </div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="linkTel"></span>
                            </div>
                        </div>
                    </li>
                </ul>
                <div class="zhuyi">
                    <div class="con_l">
                    </div>
                    <div class="zhuyi_nr">
                        <h2>
                            注册网站用户，需认真填写上表:</h2>
                        用户要自觉遵守国家有关法律、法规，遵守网上道德，对于发布违法、不健康或不真实信息的用户，本站有权删除其所有发布信息，并拒绝其使用该用户名。</div>
                    <div class="clear">
                    </div>
                </div>
                <div class="zhuyi">
                    <div class="con_l">
                    </div>
                    <div class="tongyi" style="padding-top: 4px;">
                        <input name="checkbox" type="checkbox" value="name" checked="checked" required validationMessage="请接受服务条款"  />我已阅读上述注意事项，同意并接受该事项！</div>
                        <span align="center"class="k-invalid-msg" data-for="checkbox"></span>
                    <div class="clear">
                      
                    </div>
                </div>
                <div class="zhuyi">
                    <div class="con_l">
                    </div>
                    <div class="zhuce">
                        <a href="javascript:void(0);">
<%--                      <input id="button" name="button" type="button" src="images/zhuceicon.jpg" width="242" height="54"  />--%>
                           <img id="button" name="button" src="images/zhuceicon.jpg" width="242" height="54"  />
<%--                          <input id="button" name="button" type="button" value="注册"/>--%>

                           </a>
                                                 
                        </div>
                      <div class="goback">

                      <img id="back" name="back" src="images/back.jpg" alt=""width="102" height="54"  />
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="clear">
                </div>
               
            </div>
            <div>
                <img src="images/foot01.jpg" width="700" height="6" /></div>
        </div>
     </form>
     </div>
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">      
    </telerik:RadScriptManager>
            </div>
     <!--企业修改-->
      <div class="content" id="content1">
      <div class="main">
                        <ul class="input_test">
                            <li>
                                <input id="inp_name" class="input_out" type="text" onfocus="this.className='input_on';this.onmouseout=''"
                                    onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};"
                                    onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"
                                    style="background: url(images/yh.gif) 5px center no-repeat; padding-left: 26px;
                                    width: 212px; font-family: Verdana, Geneva, sans-serif; font-size: 14px;" />
                            </li>
                            <li>
                                <input id="inp_pass" class="input_out" name="" type="password" onfocus="this.className='input_on';this.onmouseout=''"
                                    onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};"
                                    onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"
                                    style="background: url(images/mm.gif) 5px center no-repeat; padding-left: 26px;
                                    width: 212px; font-family: Verdana, Geneva, sans-serif; font-size: 14px;" />
                            </li>
                        </ul>
      <div class="btn"><a id="shichangLogin" style="cursor: pointer;">确认</a></div>
      </div>
      <form id="formEdit" name="formEdit" action="">
      <div id="divEdit" style="display:none;width:700px;margin:0 auto" >
      <div id="divUser" valtype="0">
      <ul>
        <li class="con_main">
                        <div class="con_l">
                            请输入你的用户名</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="UserName"  name="userName1" id="userName1" type="text" style="width: 275px" required validationMessage="请输入用户名"/></span>
                            </div>
                            <div class="zuiyou">
                           <span class="k-invalid-msg" data-for="userName1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            设定一个密码</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="Password"  name="passWord1" type="passWord1" style="width: 275px" required validationMessage="请输入密码" /></span>
                            </div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="passWord1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            请再次输入密码确认</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="Password"  name="passwordR1" id="passwordR1" type="password" style="width: 275px" required validationMessage="请再次输入密码"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="passwordR1"></span>
                            </div>
                        </div>
                    </li>
      </ul>
      </div>
      <div id="divCorp" valtype="0" >
        <ul >
                    <li class="con_main">
                        <div class="con_l">
                            企业名称</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                   <input  control="CorpName" name="corpName1" id="corpName1" type="text" style="width: 275px" pattern="^[a-zA-Z\u4e00-\u9fa5()（）]+$" required validationMessage="请输入公司名称" data-pattern-msg="只能输入汉字、字母、小括号"/>                                                              
                             </span>
                            </div>
                            <div class="zuiyou">
                              <span class="k-invalid-msg" data-for="corpName1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            组织机构代码</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="OrginazationCode" name="orgCode1" id="orgCode1" type="text" style="width: 275px" pattern="\d{8}[-][\d|X]" required validationMessage="请输入组织机构代码"  data-pattern-msg="无效的组织机构代码"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="orgCode1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            营业执照字号</div>
                        <div class="con_r" id="Div1">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="BussinessNum" name="bussinessNum1" id="bussinessNum1"  type="text" style="width: 275px" pattern="^[0-9]*$" required validationMessage="请输入营业执照号码"  data-pattern-msg="无效的营业执照号码" /></span>
                            </div>
                            <div class="zuiyou">
                              <span class="k-invalid-msg" data-for="bussinessNum1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            企业注册地</div>
                        <div class="con_r">
                            <div class="qy_usual"><ucArea:ucArea ID="ucArea1" Name="ucArea" runat="server" />
                                </div>
                            <div class="zuiyou">
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            电子邮箱地址</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="Email" name="email1" id="email1" type="email" style="width: 275px;" required validationMessage="请输入邮箱地址" data-email-msg="邮箱格式无效"/></span>
                            </div>
                            <div class="zuiyou">
                             <span class="k-invalid-msg" data-for="email1"></span>
                            </div>
                        </div>
                    </li>
                    <li class="con_main">
                        <div class="con_l">
                            联系电话</div>
                        <div class="con_r">
                            <div class="qy_usual">
                                <span class="qy_type_l"></span><span class="qy_usual_r">
                                    <input control="Tel" name="linkTel1" id="linkTel1" type="text" style="width: 275px;" pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" required validationMessage="请输入联系电话"  data-pattern-msg="无效的联系号码" /></span>
                            </div>
                            <div class="zuiyou">
                            <span class="k-invalid-msg" data-for="linkTel1"></span>
                            </div>
                        </div>
                    </li>
                </ul>                     
      </div>
      <div style="clear:both"></div>
      <div class="btn"><a id="corpRegEdit" style="cursor: pointer;">提交</a></div>
      </div>
      </form>
      <div style="clear:both"></div>
      </div>
      </div>
      </div>
        
        <ucUserRight:UCUserRight ID="UCUserRight1" runat="server" />
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue">
        </telerik:RadWindowManager>
</body>
</html>